<template>
	<view class="page">
		<up-navbar title="我的名片" :autoBack="true" safeAreaInsetTop placeholder> </up-navbar>		
		
		<view class="yanshi"    >
			<view  class="sgeg" :style="{ backgroundImage: 'url(' + jing + ')' }">
				
				<view  style="width: 150rpx; margin: 0 auto; height: 150rpx;      border-radius: 50%; ">
					<image class="" :src="nanrong.avatar" alt="" style="width:100%;height:100%; border-radius: 50%; margin-top: -80rpx	; " />
				</view>
				<view  style="width: 30%; margin: 0 auto; height: 200rpx; color: #000;   margin-top: -90rpx;  ">
					<view style="text-align: center; line-height: 63rpx;"><text style="font-size: 30rpx; font-weight: 900;">{{nanrong.nickname}}</text></view>
					<view style="text-align: center;"><text>{{nanrong.mobile}}</text></view>
				</view>
				
				
			</view> 
			
			<view style="width: 220rpx; margin: 0 auto; height: 220rpx;  ">
				<image class="" :src="$BASE_URL+nanrong.qrcode" alt="" style="width:100%;height:100%;  margin-top: -130rpx; " />
			</view>
			<view style="width: 50%; margin: 0 auto; margin-top: -90rpx; ">
				<view style="text-align: center; line-height: 63rpx;"><text  style="color: #999999;" >扫一扫成为我的客户</text></view>
			</view>
			<view style="width: 50%; margin: 0 auto;height: 130rpx;  color: #D05809; ">
				<view style="font-size:60rpx;font-weight: 500;text-align:center;">
					<text> 港</text>
					<text> 中 </text>
					<text> 盈 </text>
				</view>
				<view style="font-size:30rpx;font-weight: 500;text-align:center;">
					<text> HCY COMMERCE </text>
				</view>
				<!-- <image class="" src="/static/logos.png" alt="" style="width:100%;height:100%; " /> -->
			</view>
			
		</view>
		
		<view style="  ">
			<view style="width: 90%; margin: 0 auto;  margin-top: 50rpx; margin-bottom: 20rpx; ">
				<view>
					<!-- <button open-type="share">
					
					  分享
					</button> -->
					<up-button class="custom-style" open-type="share" shape="circle" color="#FF6A04" text="分享" @click="onShareAppMessage"></up-button>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	import request from '@/utils/request'
	export default {
		data() {
			return {
				url:request,
				jing:request+'/tupan/beijing.png',
				// touxiang:'https://cdn.uviewui.com/uview/album/1.jpg',
				nanrong:'',
			}
		},
		onShow() {
			this.kehuxiangqing()
		},
		methods: {
			
			kehuxiangqing() {
			
			
				this.$request({
					url: '/api/User/getMyCard',
					header: "application/x-www-form-urlencoded",
					data: {}
				}).then(res => {
					if (res.code == 1) {
						
						console.log(res.data)
						this.nanrong=res.data
					
					} else {
			
			
					}
				})
			},

		},
		onShareAppMessage(res) {
			
		var insg = uni.getStorageSync('userinfo')
		      if (res.from === "button") {
		        // 来自页面内分享按钮
		        console.log(res.target);
		      }
		      return {
		        title: "我的名片", //分享的名称
		        path: "/pages/index/index?sourceUserId="+insg.id, // 点击链接进入的页面
		        mpId: "xxxxxxxxxxxxxxxx", //此处配置微信小程序的AppId
		      };
		    },
			// 发送给朋友
				  //  onShareAppMessage(res) {
				  //   if (res.from === "button") {
				  //     // 来自页面内分享按钮
				  //     console.log(res.target);
				  //   }
				  //   return {
				  //     title: "我的名片", //分享的名称
				  //     path: "/pages/my/ming_pian/ming_pian", // 点击链接进入的页面
				  //     mpId: "xxxxxxxxxxxxxxxx", //此处配置微信小程序的AppId
				  //   };
				  // }
				  //分享到朋友圈
				   onShareTimeline(res) {
				    return {
				      title: "文本",
				      type: 0,
				      summary: "",
				    };
				  }
			
			
	}
</script>

<style>
.page {
		background: #F8F8F8;
	}
	.sgeg{
		height: 365rpx;
		background-size: cover;
		background-position: center;
		background-repeat: no-repeat;
	}
	.yanshi {
		width: 95%;
		margin: 0 auto;
		    margin-top: 200rpx;
		background-color: #fff;
		/* position: relative; */
		  
		height: 800rpx;
		
	}
</style>
